<!--{template admin/header}-->
<script type="text/javascript" src="js/iColorPicker.js"></script>
<script type="text/javascript">
function insert_share_type(share_type) { 
	var types = ['tag', 'topic', 'channel', 'recommend'];
	for (i=0; i<types.length; i++) {
		var typeid = '#' + types[i] + '_type';
		if(share_type == types[i]) {
			$(typeid).show();
		} else {
			$(typeid).hide();
		}
	}
}
</script>
<style type="text/css">
<!--
.STYLE2 {color: #666666}
.STYLE3 {color: #FF0000}
-->
</style>
<table width="100%" align="center" cellpadding="4" cellspacing="1" class="tableborder">
  <tr>
    <td width="14%"><span class="STYLE3">提示：以下是系统默认选项，必须点保存按钮才可以创建站外调用。</span></td>
  </tr>
  <!--{if $this->
  Code == 'modify'}-->
  <!--{/if}-->
</table>

<div class="nav3">
  <ul class="cc">
    <li class="current" id="li1"><a href="javascript:void(0);" onclick="setTable(1);">站外调用设置</a></li>
    <li id="li2"><a href="javascript:void(0);" onclick="setTable(2);">站外调用页面调整</a></li>
  </ul>
</div>
<script type="text/javascript">
function setTable(table){
	if(table == 1){
		document.getElementById('li1').className='current';
		document.getElementById("table1").style.display = "block";
		document.getElementById("table2").style.display = "none";
		document.getElementById('li2').className='';
	}else{
		document.getElementById('li2').className='current';
		document.getElementById("table2").style.display = "block";
		document.getElementById("table1").style.display = "none";
		document.getElementById('li1').className='';
	}

}
</script>
<form method="post" action="{$action}" enctype="multipart/form-data" name="add_share"  id="add_share">
<table id="table1" cellspacing="1" cellpadding="4" width="100%" align="center">
<tr>
<td>

  <table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
  <tr class="header">
	  <td  colspan="2">1、基本设置</td>
	</tr>
	<tr>
	  <td width="157">调用描述</td>
	  <td width="88%"><input name="name" type="text" id="name" value="{$sharelist[name]}" /> 
	    &nbsp;
	    <input name="ids" type="hidden" id="ids" value="{$ids}" />	    
	    &nbsp;（仅用于区分不同的调用，不在站外调用中显示）</td>
	</tr>
  </table>

  <table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
	<tr class="header">
		<td colspan="2">2、显示设置</td>
	</tr>
	<tr>
	  <td width="180" align="right">页面编码类型：</td>
	  <td>
		<input type="radio" name="share[show][topic_charset]" value="gbk" {eval if($share[topic_charset] != "utf-8") echo "checked=checkbox";}/>
	  gbk&nbsp;&nbsp;
	  <input type="radio" name="share[show][topic_charset]" value="utf-8" {eval if($share[topic_charset] == "utf-8") echo "checked=checkbox";}/>
	  utf-8</td>
	</tr>

	<tr>
	  <td width="180" align="right">指定显示字符数：</td>
	  <td><input name="share[show][string]" id="topic_string" type="text" value="{$share[string]}" style="width:100px; " />
	  &nbsp;/ 字符 （避免内容显示过长，为空则显示全部） </td>
	</tr>
	<tr>
	  <td width="180" align="right">指定显示条数：</td>
	  <td><input name="share[show][limit]" id="topic_limit"  type="text" value="{$share[limit]}" style="width:100px; "> 
	  / 条 </td>
	</tr>
	<tr>
	  <td width="180" align="right">指定内容类型：</td>
	  <td>
	  	<select name="type" id="type" onchange="insert_share_type(this.value);">
		  <option value="" selected="selected">最新微博</option>
	  	  <option value="topic" {eval if($sharelist[type] == 'topic') echo 'selected="selected"';}>用户微博</option>
	  	  <option value="tag" {eval if($sharelist[type] == 'tag') echo 'selected="selected"';}>话题微博</option>
	  	  <option value="channel" {eval if($sharelist[type] == 'channel') echo 'selected="selected"';}>频道微博</option>
	  	  <option value="recommend" {eval if($sharelist[type] == 'recommend') echo 'selected="selected"';}>推荐微博</option>
	  	  <option value="live" {eval if($sharelist[type] == 'live') echo 'selected="selected"';}>最新直播</option>
	    </select> 
	  	&nbsp;&nbsp;（可显示指定用户或指定话题相关的微博）
	  	<!--{eval if($sharelist[type] == 'topic') $topic_display = 'block'; else $topic_display = 'none';}-->
	  	<div id="topic_type" style="display:{$topic_display};">
	  		<div>指定用户找微博：</div>
	  		<div><textarea name="share[nickname]" style="width:500px; height:40px;">{$sharelist[nickname]}</textarea>
				<br />
			  <span class="STYLE2">提示：可填写指定用户昵称，多个用户请用 | 隔开。</span>
			  <br />		</div>
	  	</div>
	  	<!--{eval if ($sharelist[type] == 'tag') $tag_display = 'block'; else $tag_display = 'none'; }-->
	  	<div id="tag_type" style="display:{$tag_display};">
	  		<div>指定话题找微博：</div>
	  		<div><textarea name="share[tag]"  style="width:500px; height:40px;">{$sharelist[tag]}</textarea>
		          <br />
		          <span class="STYLE2">提示：可填写指定话题，多个话题请用 | 隔开。</span><br />		 </div>
	  	</div>
	  	<!--{eval if ($sharelist[type] == 'channel') $channel_display = 'block'; else $channel_display = 'none'; }-->
	  	<div id="channel_type" style="display:{$channel_display};">
	  		<div>指定频道找微博：</div>
	  		<div><textarea name="share[show][channel][name]"  style="width:500px; height:40px;">{$share[channel][name]}</textarea>
		          <br />
		          <span class="STYLE2">提示：可填写指定频道，多个频道请用 | 隔开。</span><br />		 </div>
	  	</div>
	  	<!--{eval if ($sharelist[type] == 'recommend') $recommend_display = 'block'; else $recommend_display = 'none'; }-->
	  	<div id="recommend_type" style="display:{$recommend_display};">
	  		<div>指定频道或圈子找推荐的微博：</div>
	  		<div><select name="share[show][recommend][item]">
	  			<option value=""{if ''==$share[recommend][item]} selected="selected" {/if}>全部推荐的微博</option>
	  			<option value="qun"{if 'qun'==$share[recommend][item]} selected="selected" {/if}>指定圈子下推荐的微博</option>
	  			<option value="channel"{if 'channel'==$share[recommend][item]} selected="selected" {/if}>指定频道下推荐的微博</option>
	  		</select></div>
	  		<div><textarea name="share[show][recommend][item_id]"  style="width:500px; height:20px;">{$share[recommend][item_id]}</textarea>
		          <br />
		          <span class="STYLE2">提示：可填写指定圈子或频道的ID，多个请用 | 隔开；为空时取出所有推荐的微博。</span><br />		 </div>
	  	</div>
	 </td>
	</tr>
	<tr>
	  <td>&nbsp;</td>
	  <td><button name="do" value='' type="submit" class="button">保 存</button>
	     <button class="button" type="button" onclick="window.location.href='nanbo.php?mod=share';return false;">返回</button>	</td>
    </tr>
    <!--{if $this->Code == 'modify'}-->
	<tr>
	  <td width="157">调用代码：</td>
	  <td><textarea name="textarea2" rows="2" id="textarea5" style="width:500px;">
	  <script type="text/javascript" src="{$this->Config[site_url]}/index.php?mod=share&code=recommend&ids={$ids}"></script></textarea></td>
	</tr>
<!--{/if}-->
  </table>

</td>
</tr>
</table>
<table id="table2" style="display:none" cellspacing="1" cellpadding="4" width="100%" align="center">
<tr>
<td>

  <table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
    <tr class="header">
      <td colspan="2">1、模板标签说明</td>
    </tr>
    <tr class="">
      <td width="22%"><p>
          <!--{{$_loop} $_arrlist {$_val}}-->
        </p>
        <p>&lt;span&gt; {{$_val}[nickname] &lt;/span&gt;</p>
        <p>
            <!--{{$_loop2}}-->
          </p>
      </td>
      <td><p><span class="STYLE3">{{$_loop} $_arrlist {$_val}}&nbsp;&nbsp; {{$_loop2}}</span> &nbsp;&nbsp;(循环数据标签)</p>
          <p><span class="STYLE3">&lt;span&gt; {{$_val}[nickname] &lt;/span&gt;</span> &nbsp;&nbsp;(数据显示字段，可根据参考字段进行添加需要显示的微博相关信息) </p>
        <p>&nbsp;</p></td>
    </tr>
    <tr class="">
      <td>{$site_url}</td>
      <td >网站路径：$this->Config[site_url]&nbsp;。 如：调用图片地址 <span class="STYLE3">{$site_url}/images/xx.gif </span></td>
    </tr>
  </table>
  <table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
    <tr class="header">
      <td colspan="5">2、字段意义说明（鼠标悬浮查看）</td>
    </tr>
    <tr>
      <td width="12%" height="30"><span title="用户昵称">{{$_val}[nickname]}</span></td>
      <td width="12%" height="30"> <span title="用户帐号">{{$_val}[username]}</span></td>
      <td width="15%" height="30"><span title="用户头像">{{$_val}[face_original]}</span></td>
      <td width="9%"><span title="微博ID">{{$_val}[tid]}</span></td>
      <td width="52%"><span title="微博内容">{{$_val}[content]}</span></td>
    </tr>
    <tr>
      <td height="30"><span title="微博时间">{{$_val}[dateline]}</span></td>
      <td height="30"><span title="微博评论数">{{$_val}[replys]}</span></td>
      <td height="30"><span title="微博转发数">{{$_val}[forwords]}</span></td>
      <td height="30"><span title="微博视频图片">{{$_val}[VideoImg]}</span></td>
      <td height="30">&nbsp;</td>
    </tr>
  </table>
  <table cellspacing="1" cellpadding="4" width="100%" align="center" class="tableborder">
  <tr class="header">
	  <td>3、可自定义模板</td>
	</tr>
    <tr>
      <td valign="top"><textarea name="sharetemp" id="sharetemp" cols="45" rows="5" style="width:90%; height:300px;">{$web_share_temp}</textarea></td>
    </tr>
	<tr>
	  <td><button name="do" value='' type="submit" class="button">保 存</button>&nbsp;
	     <button class="button" type="button" onclick="window.location.href='nanbo.php?mod=share';return false;">返回</button>	</td>
    </tr>
  </table>
      <!--{if $this->Code == 'modify'}-->
      <table>
	<tr>
	  <td width="157">调用代码：</td>
	  <td><textarea name="textarea2" rows="2" id="textarea5" style="width:500px;">
	  <script type="text/javascript" src="{$this->Config[site_url]}/index.php?mod=share&code=recommend&ids={$ids}"></script></textarea></td>
	</tr>
	</table>
<!--{/if}-->

</tr>
</table>
</form>